<?php

namespace common\models\member;

use Yii;

/**
 * This is the model class for table "{{%member_data}}".
 *
 * @property int $id
 * @property int $user_id 用户ID
 * @property int $member_id 会员ID
 * @property string $realname 真实姓名
 * @property string $mobile 手机号
 * @property string $idcardno 身份证号
 * @property string $photo 人像照
 * @property string $passport_front 证件正面
 * @property string $passport_reverse 证件反面
 * @property int $status 资料状态
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 * @property string $mark 备注
 */
class MemberData extends \common\db\ActiveRecord {

    CONST STATUS_ACTIVE = 10;
    CONST STATUS_DEFAULT = 0;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%member_data}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['user_id', 'member_id', 'status', 'created_at', 'updated_at'], 'integer'],
            [['mobile', 'idcardno'], 'required'],
            [['realname'], 'string', 'max' => 50],
            [['mobile'], 'string', 'max' => 11],
            [['idcardno'], 'string', 'max' => 18],
            [['photo', 'passport_front', 'passport_reverse', 'mark'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => '用户ID',
            'member_id' => '会员ID',
            'realname' => '真实姓名',
            'mobile' => '手机号',
            'idcardno' => '身份证号',
            'photo' => '人像照',
            'passport_front' => '证件正面',
            'passport_reverse' => '证件反面',
            'status' => '资料状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'mark' => '备注',
        ];
    }

}
